<?php
class ChristmasCommonVo extends SzAbstractMySqlVo
{

    private $userId;
    private $aid;
    private $physical;
    private $usePhysical;
    private $first;
    private $second;
    private $third;
    private $num1;
    private $num2;
    private $num3;
    private $firstTreasure;
    private $secondTreasure;
    private $thirdTreasure;
    private $dropSpecial1;
    private $dropSpecial2;
    private $dropSpecial3;
    private $rocksNum;
    private $rocksReward;
    private $sendPhysical;
    private $createTime;
    private $updateTime;
    private $endTime;

    /**
     * Initialize ChristmasCommonVo.
     *
     * @param $userId
     * @param $aid
     * @param $physical
     * @param $usePhysical
     * @param $first
     * @param $second
     * @param $third
     * @param $num1
     * @param $num2
     * @param $num3
     * @param $firstTreasure
     * @param $secondTreasure
     * @param $thirdTreasure
     * @param $dropSpecial1
     * @param $dropSpecial2
     * @param $dropSpecial3
     * @param $rocksNum
     * @param $rocksReward
     * @param $sendPhysical
     * @param $createTime
     * @param $updateTime
     * @param $endTime
     * @param boolean $isInsert default false, means for now this vo is initialized not for insert process
     * @return ChristmasCommonVo
     */
    public function __construct($userId, $aid, $physical, $usePhysical, $first, $second, $third, $num1, $num2, $num3, $firstTreasure, $secondTreasure, $thirdTreasure, $dropSpecial1, $dropSpecial2, $dropSpecial3, $rocksNum, $rocksReward, $sendPhysical, $createTime, $updateTime, $endTime, $isInsert = false) {
        $this->userId = $userId;
        $this->aid = $aid;
        $this->physical = $physical;
        $this->usePhysical = $usePhysical;
        $this->first = $first;
        $this->second = $second;
        $this->third = $third;
        $this->num1 = $num1;
        $this->num2 = $num2;
        $this->num3 = $num3;
        $this->firstTreasure = $firstTreasure;
        $this->secondTreasure = $secondTreasure;
        $this->thirdTreasure = $thirdTreasure;
        $this->dropSpecial1 = json_decode($dropSpecial1, true);
        $this->dropSpecial2 = json_decode($dropSpecial2, true);
        $this->dropSpecial3 = json_decode($dropSpecial3, true);
        $this->rocksNum = $rocksNum;
        $this->rocksReward = json_decode($rocksReward, true);
        $this->sendPhysical = $sendPhysical;
        $this->createTime = $createTime;
        $this->updateTime = $updateTime;
        $this->endTime = $endTime;

        $this->isInsert = $isInsert;
        $this->voClassName = 'ChristmasCommonVo';
        $this->ormName = 'ChristmasCommon';
    }

    /**
     * @see SzAbstractVo::toArray
     */
    public function toArray($needEncode = false)
    {
        return array(
            'userId' => $this->getUserId(),
            'aid' => $this->getAid(),
            'physical' => $this->getPhysical(),
            'usePhysical' => $this->getUsePhysical(),
            'first' => $this->getFirst(),
            'second' => $this->getSecond(),
            'third' => $this->getThird(),
            'num1' => $this->getNum1(),
            'num2' => $this->getNum2(),
            'num3' => $this->getNum3(),
            'firstTreasure' => $this->getFirstTreasure(),
            'secondTreasure' => $this->getSecondTreasure(),
            'thirdTreasure' => $this->getThirdTreasure(),
            'dropSpecial1' => ($needEncode) ? $this->getDropSpecial1() : $this->getRawDropSpecial1(),
            'dropSpecial2' => ($needEncode) ? $this->getDropSpecial2() : $this->getRawDropSpecial2(),
            'dropSpecial3' => ($needEncode) ? $this->getDropSpecial3() : $this->getRawDropSpecial3(),
            'rocksNum' => $this->getRocksNum(),
            'rocksReward' => ($needEncode) ? $this->getRocksReward() : $this->getRawRocksReward(),
            'sendPhysical' => $this->getSendPhysical(),
            'createTime' => $this->getCreateTime(),
            'updateTime' => $this->getUpdateTime(),
            'endTime' => $this->getEndTime(),
        );
    }

    /**
     * @see SzAbstractVo::toEntireArray
     */
    public function toEntireArray($needEncode = false)
    {
        return array(
            'userId' => $this->getUserId(),
            'aid' => $this->getAid(),
            'physical' => $this->getPhysical(),
            'usePhysical' => $this->getUsePhysical(),
            'first' => $this->getFirst(),
            'second' => $this->getSecond(),
            'third' => $this->getThird(),
            'num1' => $this->getNum1(),
            'num2' => $this->getNum2(),
            'num3' => $this->getNum3(),
            'firstTreasure' => $this->getFirstTreasure(),
            'secondTreasure' => $this->getSecondTreasure(),
            'thirdTreasure' => $this->getThirdTreasure(),
            'dropSpecial1' => ($needEncode) ? $this->getDropSpecial1() : $this->getRawDropSpecial1(),
            'dropSpecial2' => ($needEncode) ? $this->getDropSpecial2() : $this->getRawDropSpecial2(),
            'dropSpecial3' => ($needEncode) ? $this->getDropSpecial3() : $this->getRawDropSpecial3(),
            'rocksNum' => $this->getRocksNum(),
            'rocksReward' => ($needEncode) ? $this->getRocksReward() : $this->getRawRocksReward(),
            'sendPhysical' => $this->getSendPhysical(),
            'createTime' => $this->getCreateTime(),
            'updateTime' => $this->getUpdateTime(),
            'endTime' => $this->getEndTime(),
        );
    }

    /**
     * @see SzAbstractVo::toPureArray
     */
    public function toPureArray()
    {
        return array(
            $this->getUserId(),
            $this->getAid(),
            $this->getPhysical(),
            $this->getUsePhysical(),
            $this->getFirst(),
            $this->getSecond(),
            $this->getThird(),
            $this->getNum1(),
            $this->getNum2(),
            $this->getNum3(),
            $this->getFirstTreasure(),
            $this->getSecondTreasure(),
            $this->getThirdTreasure(),
            $this->getDropSpecial1(),
            $this->getDropSpecial2(),
            $this->getDropSpecial3(),
            $this->getRocksNum(),
            $this->getRocksReward(),
            $this->getSendPhysical(),
            $this->getCreateTime(),
            $this->getUpdateTime(),
            $this->getEndTime(),
        );
    }

    public function getUserId()
    {
        return $this->userId;
    }

    public function setUserId($val)
    {
        $this->saveColumnStatus(0, $this->userId);
        $this->userId = $val;
    }

    public function getAid()
    {
        return $this->aid;
    }

    public function setAid($val)
    {
        $this->saveColumnStatus(1, $this->aid);
        $this->aid = $val;
    }

    public function getPhysical()
    {
        return $this->physical;
    }

    public function setPhysical($val)
    {
        $this->saveColumnStatus(2, $this->physical);
        $this->physical = $val;
    }

    public function getUsePhysical()
    {
        return $this->usePhysical;
    }

    public function setUsePhysical($val)
    {
        $this->saveColumnStatus(3, $this->usePhysical);
        $this->usePhysical = $val;
    }

    public function getFirst()
    {
        return $this->first;
    }

    public function setFirst($val)
    {
        $this->saveColumnStatus(4, $this->first);
        $this->first = $val;
    }

    public function getSecond()
    {
        return $this->second;
    }

    public function setSecond($val)
    {
        $this->saveColumnStatus(5, $this->second);
        $this->second = $val;
    }

    public function getThird()
    {
        return $this->third;
    }

    public function setThird($val)
    {
        $this->saveColumnStatus(6, $this->third);
        $this->third = $val;
    }

    public function getNum1()
    {
        return $this->num1;
    }

    public function setNum1($val)
    {
        $this->saveColumnStatus(7, $this->num1);
        $this->num1 = $val;
    }

    public function getNum2()
    {
        return $this->num2;
    }

    public function setNum2($val)
    {
        $this->saveColumnStatus(8, $this->num2);
        $this->num2 = $val;
    }

    public function getNum3()
    {
        return $this->num3;
    }

    public function setNum3($val)
    {
        $this->saveColumnStatus(9, $this->num3);
        $this->num3 = $val;
    }

    public function getFirstTreasure()
    {
        return $this->firstTreasure;
    }

    public function setFirstTreasure($val)
    {
        $this->saveColumnStatus(10, $this->firstTreasure);
        $this->firstTreasure = $val;
    }

    public function getSecondTreasure()
    {
        return $this->secondTreasure;
    }

    public function setSecondTreasure($val)
    {
        $this->saveColumnStatus(11, $this->secondTreasure);
        $this->secondTreasure = $val;
    }

    public function getThirdTreasure()
    {
        return $this->thirdTreasure;
    }

    public function setThirdTreasure($val)
    {
        $this->saveColumnStatus(12, $this->thirdTreasure);
        $this->thirdTreasure = $val;
    }

    public function getDropSpecial1()
    {
        return json_encode($this->dropSpecial1);
    }

    public function getRawDropSpecial1()
    {
        return $this->dropSpecial1;
    }

    public function setDropSpecial1($val)
    {
        $encodedLength = SzUtility::strLen(json_encode($val));
        if ($encodedLength > 25600) {
            SzLogger::get()->error('[ChristmasCommonVo] The length of column dropSpecial1 exceed the limit, length / limit: ' . $encodedLength . ' / 25600');
            throw new SzException(10522, array('ChristmasCommonVo', '25600', $encodedLength));
        } else if ($encodedLength > 23040) {
            SzLogger::get()->warn('[ChristmasCommonVo] The length of column dropSpecial1 exceed the warning level, length / limit: ' . $encodedLength . ' / 25600');
        }
        $this->saveColumnStatus(13, $this->dropSpecial1);
        $this->dropSpecial1 = $val;
    }

    public function getDropSpecial2()
    {
        return json_encode($this->dropSpecial2);
    }

    public function getRawDropSpecial2()
    {
        return $this->dropSpecial2;
    }

    public function setDropSpecial2($val)
    {
        $encodedLength = SzUtility::strLen(json_encode($val));
        if ($encodedLength > 25600) {
            SzLogger::get()->error('[ChristmasCommonVo] The length of column dropSpecial2 exceed the limit, length / limit: ' . $encodedLength . ' / 25600');
            throw new SzException(10522, array('ChristmasCommonVo', '25600', $encodedLength));
        } else if ($encodedLength > 23040) {
            SzLogger::get()->warn('[ChristmasCommonVo] The length of column dropSpecial2 exceed the warning level, length / limit: ' . $encodedLength . ' / 25600');
        }
        $this->saveColumnStatus(14, $this->dropSpecial2);
        $this->dropSpecial2 = $val;
    }

    public function getDropSpecial3()
    {
        return json_encode($this->dropSpecial3);
    }

    public function getRawDropSpecial3()
    {
        return $this->dropSpecial3;
    }

    public function setDropSpecial3($val)
    {
        $encodedLength = SzUtility::strLen(json_encode($val));
        if ($encodedLength > 25600) {
            SzLogger::get()->error('[ChristmasCommonVo] The length of column dropSpecial3 exceed the limit, length / limit: ' . $encodedLength . ' / 25600');
            throw new SzException(10522, array('ChristmasCommonVo', '25600', $encodedLength));
        } else if ($encodedLength > 23040) {
            SzLogger::get()->warn('[ChristmasCommonVo] The length of column dropSpecial3 exceed the warning level, length / limit: ' . $encodedLength . ' / 25600');
        }
        $this->saveColumnStatus(15, $this->dropSpecial3);
        $this->dropSpecial3 = $val;
    }

    public function getRocksNum()
    {
        return $this->rocksNum;
    }

    public function setRocksNum($val)
    {
        $this->saveColumnStatus(16, $this->rocksNum);
        $this->rocksNum = $val;
    }

    public function getRocksReward()
    {
        return json_encode($this->rocksReward);
    }

    public function getRawRocksReward()
    {
        return $this->rocksReward;
    }

    public function setRocksReward($val)
    {
        $encodedLength = SzUtility::strLen(json_encode($val));
        if ($encodedLength > 25600) {
            SzLogger::get()->error('[ChristmasCommonVo] The length of column rocksReward exceed the limit, length / limit: ' . $encodedLength . ' / 25600');
            throw new SzException(10522, array('ChristmasCommonVo', '25600', $encodedLength));
        } else if ($encodedLength > 23040) {
            SzLogger::get()->warn('[ChristmasCommonVo] The length of column rocksReward exceed the warning level, length / limit: ' . $encodedLength . ' / 25600');
        }
        $this->saveColumnStatus(17, $this->rocksReward);
        $this->rocksReward = $val;
    }

    public function getSendPhysical()
    {
        return $this->sendPhysical;
    }

    public function setSendPhysical($val)
    {
        $this->saveColumnStatus(18, $this->sendPhysical);
        $this->sendPhysical = $val;
    }

    public function getCreateTime()
    {
        return $this->createTime;
    }

    public function setCreateTime($val)
    {
        $this->saveColumnStatus(19, $this->createTime);
        $this->createTime = $val;
    }

    public function getUpdateTime()
    {
        return $this->updateTime;
    }

    public function setUpdateTime($val)
    {
        $this->saveColumnStatus(20, $this->updateTime);
        $this->updateTime = $val;
    }

    public function getEndTime()
    {
        return $this->endTime;
    }

    public function setEndTime($val)
    {
        $this->saveColumnStatus(21, $this->endTime);
        $this->endTime = $val;
    }

}